﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using CMS.BLL;

public partial class ILTravel : System.Web.UI.MasterPage
{

    private int nCurrentLanguage = Support.GetCurrentLanguage(); 
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.SetLabel();
            BindBanner();
        }
    }

    private void SetLabel()
    {
        lnkAboutUs.Text = MultipleLanguage.ABOUTUS[nCurrentLanguage - 1];
        lnkBooking.Text = MultipleLanguage.BOOKING[nCurrentLanguage - 1];
        lnkPayment.Text = MultipleLanguage.LBL_PAYMENT[nCurrentLanguage - 1];
        lnkTestimonial.Text = MultipleLanguage.TESTIMONIAL[nCurrentLanguage - 1];
        lnkAboutUs.NavigateUrl = "~/StaticPages.aspx?pid=35";
        lnkBooking.NavigateUrl = "~/TourBooking.aspx";
        lnkPayment.NavigateUrl = "~/Payment.aspx";
        lnkTestimonial.NavigateUrl = "~/Testimonial.aspx";

        lblFooterAboutUs.Text = MultipleLanguage.ABOUTUS[nCurrentLanguage - 1].ToUpper();
        lblFooterContactUs.Text = MultipleLanguage.CONTACT[nCurrentLanguage - 1].ToUpper();
        lblFooterTravelGuide.Text = MultipleLanguage.TRAVELGUIDE[nCurrentLanguage - 1].ToUpper();
        lblFooterTravelService.Text = MultipleLanguage.TRAVELSERVICE[nCurrentLanguage - 1].ToUpper();
        lblFooterVisaService.Text = MultipleLanguage.VISASERVICE[nCurrentLanguage - 1].ToUpper();
        lblFotterLinkExchange.Text = MultipleLanguage.LINKEXCHANGE[nCurrentLanguage - 1].ToUpper();
    }

    protected void btnSpain_Click(object sender, ImageClickEventArgs e)
    {
        Session["CurrentLanguage"] = "3";
        Response.Redirect(Request.RawUrl);
    }
    protected void btnEN_Click(object sender, ImageClickEventArgs e)
    {
        Session["CurrentLanguage"] = "2";
        Response.Redirect(Request.RawUrl);
    }

    private void BindBanner()
    {
        Banner objBanner = new Banner();
        DataTable dtbBanner = new DataTable();
        dtbBanner = objBanner.GetAll();
        rptGal.DataSource = dtbBanner;
        rptGal.DataBind();
    }

    protected void rptGal_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if ((e.Item.ItemType != ListItemType.Header) && (e.Item.ItemType != ListItemType.Footer))
        {

            Image imgGal = (Image)e.Item.FindControl("imgGal");
         
            imgGal.ImageUrl = "~/Images/Upload/Banner/" + ConvertData.ConvertToString(DataBinder.Eval(e.Item.DataItem, "Images"));
        }
    }
}
